

// import dashboard from "./modules/dashboard"
// import list from "./modules/list";
// import system from "./modules/system";

//import Login from "@/pages/login";
import type { RouteObject } from "react-router-dom";

//动态导入
const modules = require.context('./modules', false, /(.*)\.tsx$/);
//console.log("modules", modules.keys())

const routeMeoduleList: RouteObject[] = [];
modules.keys().forEach((key) => {
    const mod = modules(key).default;
    const modList = Array.isArray(mod) ? [...mod] : [mod];
    //console.log("modList", modList)
    routeMeoduleList.push(...modList);
})

export const routes = [
    ...routeMeoduleList,
    // {
    //     path: "/login",
    //     element: <Login />
    // },
];

// export const routes = [
//     dashboard, list, system
// ];